function balance(p, pmt, r, n) {
  if (n === 0) {
    return p;
  }
  return (1 + r / 1200) *  balance(p, pmt, r, n-1) - pmt
}